home *** CD-ROM | disk | FTP | other *** search
/ The Best of Down Under Games / The Best of Down Under Games.iso / 3dfx Screen Savers / Impact / IMPSRC.ZIP / LAND.H < prev    next >
C/C++ Source or Header  |  1997-07-22  |  2KB  |  65 lines

  1. #ifndef _LAND_H_
  2. #define _LAND_H_
  3. #include <glide.h>
  4. #include "math3d.h"
  5. //#include "things.h"
  6. int NumLand;
  7. const int vertsep = 192;
  8. const int tdx = 4,tdz = tdx;
  9. const int gridsep = vertsep*(tdx);
  10. const int GridNum = 32;
  11. const int vertscnt = (tdx+1)*(tdz+1);
  12. const int sqrcnt = tdx*tdz;
  13. const int GridNum2 = GridNum*GridNum;
  14. const int LevMax = GridNum*gridsep+vertsep;
  15. const int width = (tdx)*GridNum+1,width2=width*width;
  16. const int specwidth = 256;
  17. const int VertWidth = GridNum*(tdx-1)+1;
  18. const int VertWidth2 = VertWidth*VertWidth;
  19. const int Bigsqrcnt = sqrcnt*GridNum2;
  20. typedef struct light_t{
  21.     float r,g,b,a;
  22. };
  23.  
  24. class entity_t;
  25. BOOL MyDrawTriangleTooClose(GrVertex bad1, GrVertex bad2,GrVertex bad3,
  26.                        GrVertex old1, GrVertex old2,GrVertex old3,
  27.                        Matrix rot,float x, float y, float z);
  28.  
  29. typedef struct landrect_t{
  30.     int corn[4];
  31.     float s[4];
  32.     float t[4];
  33.     int texture;
  34.     char r[4],g[4],b[4],a[4];
  35.     int CentX,CentZ;
  36. };
  37. GrVertex Start[width*width],Trans[width*width];
  38. landrect_t Rects[GridNum2*tdx*tdz],*Water;
  39. light_t lit[width*width];
  40. void Genland(void);
  41. class land_t{
  42.     private:
  43.         int MyRects[sqrcnt],*WaterRects;
  44.         int numland,numwater;
  45.         float centerx,centerz;
  46.         int id;
  47.         float pntx[5];
  48.         float pnty[5];
  49.         float pntz[5];
  50.     public:
  51.         float minx,maxx,minz,maxz;//bounding area.
  52.         int MyVerts[vertscnt];
  53.         int rendered;
  54.  
  55.         land_t();
  56.         land_t(float x, float z, int mid);
  57.         ~land_t();
  58.         //int test(Matrix rot,float x, float y, float z);
  59.         int render(Matrix rot,float x, float y, float z);
  60.         void castlight(entity_t *Other);
  61.         int generate(float x, float z, int mid);
  62. };
  63. land_t *land;
  64.  
  65. #endif